package redis

import (
	"fmt"
	"github.com/go-redis/redis"
	"week2-project/config"
)

var Rdb *redis.Client

func RedisApp() {
	app := config.AppConf.Redis
	Rdb = redis.NewClient(&redis.Options{
		Addr:     app.Addr,
		Password: app.Password, // no password set
		DB:       app.Db,       // use default DB
	})

	pong, err := Rdb.Ping().Result()
	fmt.Println(pong, err)
	// Output: PONG <nil>
}
